/**
 * 
 */
package com.example.downloadmanagerdemo.download;

import android.annotation.SuppressLint;
import android.os.Environment;
import android.os.StatFs;

/**
 * @author careyjwang
 * 
 */
public class DownloadUtils {
	public static boolean isSDCardEnable() {
		return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
	}

	@SuppressLint("NewApi")
	public static boolean isSDCardSpaceEnough() {
		StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath());
		return statFs.getAvailableBytes() > DownloadConfig.MIN_SDCARD_SPACE;
	}
}
